Leadtools.Forms.Ocr Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Run(String,String,Generic IList,DocumentFormat,OcrProgressCallback) Method
See Also 
Leadtools.Forms.Ocr Namespace > IOcrAutoRecognizeManager Interface > Run Method : Run(String,String,Generic IList,DocumentFormat,OcrProgressCallback) Method



imageFileName
The name of the file containing the image.
documentFileName
The name of the result document file.
zoneFileNames
Optional list of file names for prepared zone files for the pages. This parameter can be a null (Nothing in Visual Basic) reference.
format
The output document format. If this parameter is DocumentFormat.User, then the document saved using the native engine format set in IOcrDocumentManager.EngineFormat if the engine used supports native formats, otherwise an exception will be thrown.
callback
Optional callback to show operation progress.
imageFileName
The name of the file containing the image.
documentFileName
The name of the result document file.
zoneFileNames
Optional list of file names for prepared zone files for the pages. This parameter can be a null (Nothing in Visual Basic) reference.
format
The output document format. If this parameter is DocumentFormat.User, then the document saved using the native engine format set in IOcrDocumentManager.EngineFormat if the engine used supports native formats, otherwise an exception will be thrown.
callback
Optional callback to show operation progress.
Converts an image file on disk to a document file in the specified document format.

Syntax

Visual Basic (Declaration) 
Overloads Overridable Sub Run( _
   ByVal imageFileName As String, _
   ByVal documentFileName As String, _
   ByVal zoneFileNames As IList(Of String), _
   ByVal format As DocumentFormat, _
   ByVal callback As OcrProgressCallback _
) 
Visual Basic (Usage)Copy Code
Dim instance As IOcrAutoRecognizeManager
Dim imageFileName As String
Dim documentFileName As String
Dim zoneFileNames As IList(Of String)
Dim format As DocumentFormat
Dim callback As OcrProgressCallback
 
instance.Run(imageFileName, documentFileName, zoneFileNames, format, callback)
C++/CLI 
virtual void Run( 
   String^ imageFileName,
   String^ documentFileName,
   IList<String>^ zoneFileNames,
   DocumentFormat format,
   OcrProgressCallback^ callback
) 

Parameters

imageFileName
The name of the file containing the image.
documentFileName
The name of the result document file.
zoneFileNames
Optional list of file names for prepared zone files for the pages. This parameter can be a null (Nothing in Visual Basic) reference.
format
The output document format. If this parameter is DocumentFormat.User, then the document saved using the native engine format set in IOcrDocumentManager.EngineFormat if the engine used supports native formats, otherwise an exception will be thrown.
callback
Optional callback to show operation progress.

Example

For an example, refer to IOcrAutoRecognizeManager.

Remarks

This method will perform the following operations:

  1. Create an IOcrDocument object to store the pages into.
  2. Load the raster image pages from imageFileName add them the IOcrDocument.Pages collection using IOcrPageCollection.AddPage.
  3. If zoneFileNames contains a valid zone file name for the current page (the index in this array matches the index of the page being loaded), the zones are loaded with IOcrPage.LoadZones and applied to the page. If zoneFileNames is a null (Nothing in Visual Basic) reference or its entry for the current page is a null reference, auto-decomposing of the page is performed instead with IOcrPage.AutoZone.
  4. Calls IOcrPage.Recognize on each IOcrPage to get the OCR data of the page .
  5. Saves the IOcrDocument object to the result file name specified in documentFileName using the format specified in format.
  6. Finally, deletes the IOcrDocument object by calling IOcrDocument.Dispose.

You can use the OcrProgressCallback to show the operation progress or to abort it. For more information and an example, refer to OcrProgressCallback.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

Run(String,String,Generic IList,DocumentFormat,OcrProgressCallback) requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features